home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Bitmap / Sources / Part.r < prev    next >
Encoding:
Text File  |  1996-09-17  |  4.9 KB  |  210 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Part.r
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #define SystemSevenOrBetter 1            // we want the extended types
  13. #define    SystemSevenOrLater    1            // Types.r uses this variable
  14.  
  15. #include "Types.r"
  16. #include "SysTypes.r"
  17. #include "CodeFragmentTypes.r"
  18.  
  19. #ifndef __ODTYPES_R__
  20. #include "ODTypes.r"
  21. #endif
  22.  
  23. #ifndef FWBLDDEF_H
  24. #include "FWBldDef.h"
  25. #endif
  26.  
  27. #ifndef BINDING_K
  28. #include "Binding.k"
  29. #endif
  30.  
  31. #ifndef DEFINES_K
  32. #include "Defines.k"
  33. #endif
  34.  
  35. // CyberDog is really only supported in Metrowerks builds. Unfortunately,
  36. // we can't detect that we are in Metrowerks REZ or the Metrowerks ODFRC
  37. // plugin, so we always define FW_SUPPORTS_CYBERDOG true for resource
  38. // compiles.
  39. #ifdef FW_SUPPORTS_CYBERDOG
  40. #undef FW_SUPPORTS_CYBERDOG
  41. #endif
  42.  
  43. #define FW_SUPPORTS_CYBERDOG 1
  44.  
  45. #if FW_SUPPORTS_CYBERDOG
  46. // Cyberdog: XXX
  47. #include "Cyberdog.h"
  48. #endif
  49.  
  50. //-------------------------------------------------------------------------------------
  51. // cfrg Resource
  52. //-------------------------------------------------------------------------------------
  53.  
  54. resource 'cfrg' (0) {
  55.     {    /* array memberArray: 2 elements */
  56.         /* [1] */
  57. #ifdef FW_BUILD_MAC68K
  58.         kMotorola,
  59. #else
  60.         kPowerPC,
  61. #endif
  62.         kFullLib,
  63.         kNoVersionNum,
  64.         kNoVersionNum,
  65.         kDefaultStackSize,
  66.         kNoAppSubFolder,
  67.         kIsLib,
  68.         kOnDiskFlat,
  69.         kZeroOffset,
  70.         kWholeFork,
  71.         kODFBitmapEditor,
  72.         /* [2] */
  73. #ifdef FW_BUILD_MAC68K
  74.         kMotorola,
  75. #else
  76.         kPowerPC,
  77. #endif
  78.         kFullLib,
  79.         kNoVersionNum,
  80.         kNoVersionNum,
  81.         kDefaultStackSize,
  82.         kNoAppSubFolder,
  83.         kIsLib,
  84.         kOnDiskFlat,
  85.         kZeroOffset,
  86.         kWholeFork,
  87.         "ODFBitmap"
  88.     }
  89. };
  90.  
  91. //-------------------------------------------------------------------------------------
  92. // NMAP Resources
  93. //-------------------------------------------------------------------------------------
  94.  
  95. resource kODNameMappings (kKindCategoryMapID) {
  96.     kODKind,
  97.     {
  98.         kODFBitmapKind,
  99.         kODIsAnISOStringList
  100.         {
  101.             {
  102.                 kODCategoryPainting
  103.             }
  104.         }
  105.     }
  106. };
  107.  
  108. resource kODNameMappings (kEditorKindMapID) {
  109.     kODEditorKinds,
  110.     {    
  111.         kODFBitmapEditor,
  112.         kODIsAnISOStringList
  113.         {
  114.             {    
  115.                 kODFBitmapKind,
  116.                 // We also know how to read JPEG-compressed photographic images
  117.                 // Note that we don't *externalize* JPEGs, only internalize. For now.
  118.                 kJpegKind
  119. #if FW_SUPPORTS_CYBERDOG
  120.                 ,// Cyber-savvy parts are required to include this kind. It's a hack.
  121.                 kCyberPartKind
  122. #endif
  123.             }
  124.         }
  125.     }
  126. };
  127.  
  128. resource kODNameMappings (kEditorUserStringMapID) {
  129.     kODEditorUserString,
  130.     {    
  131.         kODFBitmapEditor,
  132.         kODIsINTLText
  133.         {
  134.             smRoman, langEnglish, kODFBitmapEditorUserString
  135.         }
  136.     }
  137. };
  138.  
  139. /*
  140.     Kind Strings (kODKindUserString)
  141.     These show up in the Editor Setup control panel, and the Document Info dialog.
  142. */
  143.  
  144. resource kODNameMappings (kKindUserStringMapID) {
  145.     kODKindUserString,
  146.     {    
  147.         kODFBitmapKind, kODIsINTLText {
  148.             smRoman, langEnglish, "Bitmap"
  149.         },
  150.         kJpegKind, kODIsINTLText {
  151.             smRoman, langEnglish, "image/jpeg"
  152.         }
  153.         // We don't specify a user string for kJpegCyberItemKind
  154.     }
  155. };
  156.  
  157. /*
  158.     Icon Mapping (kODKindOldMacOSType)
  159.     We are mapping icon families (MacIcons.rsrc) to OpenDoc kinds.
  160.     
  161.     This has nothing to do with data - unlike normal MacOS documents,
  162.     the OSType on an OpenDoc document is meaningless and does 
  163.     *absolutely nothing* except tell the Finder what icon to use.
  164. */
  165.  
  166. resource kODNameMappings (kOldMacOSTypeMapID) {
  167.     kODKindOldMacOSType,
  168.     {    
  169.         kODFBitmapKind,     kODIsMacOSType { 'DFBD' },
  170.         kJpegKind,             kODIsMacOSType { 'DFBJ' }
  171. #if FW_SUPPORTS_CYBERDOG
  172.         ,
  173.         kJpegCyberItemKind, kODIsMacOSType { 'uFBJ' }
  174. #endif
  175.     }
  176. };
  177.  
  178. /*
  179.     Importing & Translation (kODEditorPlatformKind)
  180.     This is where we specify foreign data kinds
  181.     In our case we are declaring that we can import:
  182.     Macintosh pictures (via files and drag&drop)
  183.     JPEG images (via files and drag&drop)
  184.     
  185.     It really isn't necessary to import JPEG's via drag&drop since any program
  186.     which exports JPEGs will also export PICT, but it's no trouble.
  187. */
  188.  
  189. resource kODNameMappings (kEditorPlatformKinds) {
  190.     kODEditorPlatformKind,
  191.     {    
  192.         kODFBitmapEditor, kODIsPltfmTypeSpac {
  193.             {
  194.                 kODPlatformFileType, kPICTOSType, smRoman, langEnglish, "Picture File", kODCategoryPainting,
  195.                 kODPlatformDataType, kPICTOSType, smRoman, langEnglish, "Picture Data", kODCategoryPainting,
  196.                 kODPlatformFileType, kJPEGOSType, smRoman, langEnglish, "JPEG File", kODCategoryPainting,
  197.                 kODPlatformDataType, kJPEGOSType, smRoman, langEnglish, "JPEG Data", kODCategoryPainting,
  198.                 kODPlatformFileType, kJFIFOSType, smRoman, langEnglish, "JPEG (JFIF) File", kODCategoryPainting,
  199.                 kODPlatformDataType, kJFIFOSType, smRoman, langEnglish, "JPEG (JFIF) Data", kODCategoryPainting
  200.             }
  201.         }
  202.     }
  203. };
  204.  
  205. include "MacIcons.rsrc" not 'ckid';
  206. include "Image.Pict" not 'ckid';
  207. #if FW_SUPPORTS_CYBERDOG
  208. include "FWSaveAs.rsrc" not 'ckid';
  209. #endif
  210.